#pragma once
#include "WeaponDlg.h"
#include "afxwin.h"

class CWeaponDlg;
// CWeapTTX dialog

class CWeapTTX : public CDialog
{
	DECLARE_DYNAMIC(CWeapTTX)

public:
	CWeapTTX(CWnd* pParent = NULL);   // standard constructor
	virtual ~CWeapTTX();

// Dialog Data
	enum { IDD = IDD_WEAPTTX };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
private:
	WEAPONTYPE *Weapon;
	ARMOURTYPE *Armour;
	MAGTYPE *Magazine;
	EXPLOSIVETYPE *Explosive;
	CaliberStruct *gCalibers;	
	AMMOTYPE *gAmmoTypes;
	WEAPONCLASS *gWeaponClass;
	CaliberBinds *ftbBinds;
private:
  bool m_bSaved;
  COXToolTipCtrl m_tooltip;
public:
  bool IsSaved() const { return m_bSaved; }
	afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
	void Load( CProgressBarDialog *pProgressDialog );
	//Pointers to other classes
	CWeaponDlg *pWeaponDlg;
	CItemsDlg  *pItemsDlg;
	void SetClassPointers(ClassPointers *p);
	//------------------------
	void FillWeaponStructures(WSPointers *pWSPointers);
	//Selection changing;
	void fChangeWC();
	void fChangeCal();
	void fChangeAT();
	void fChangeMag();
	//Fillers
	void fFillC();
	void fFillAT();
	//Current selections
	int icsWC;
	int icsCal;
	int icsAT;
	int icsMag;
	afx_msg void OnLbnSelchangeListWeaponClasses();
	afx_msg void OnLbnSelchangeListAmmoTypes();
	afx_msg void OnLbnSelchangeListCalibers();
	afx_msg void OnLbnSelchangeListMagazines();
	CListBox m_lbWeaponClasses;
	CListBox m_lbCalibers;
	CListBox m_lbAmmoTypes;
	CListBox m_lbMagazines;
	CComboBox m_cbCalibers;
	CComboBox m_cbAmmoTypes;
	
	afx_msg void OnEnChangeEditWeaponClassAlias();
	afx_msg void OnEnChangeEditWeapClassReloadSound();
	afx_msg void OnEnChangeEditWeapClassLNLSound();
	afx_msg void OnEnChangeEditCaliberAlias();
	afx_msg void OnEnChangeEditCaliberSound();
	afx_msg void OnEnChangeEditCaliberBurstSound();
	afx_msg void OnEnChangeEditAmmoTypeAlias();
	afx_msg void OnEnChangeEditAmmoTypesArmorMultiplier();
	afx_msg void OnEnChangeEditAmmoTypesArmorDivider();
	afx_msg void OnEnChangeEditAmmoTypesDamageMultiplier();
	afx_msg void OnEnChangeEditAmmoTypesDamageDivider();
	afx_msg void OnEnChangeEditAmmoTypesStructureMultiplier();
	afx_msg void OnEnChangeEditAmmoTypesStructureDivider();
	afx_msg void OnEnChangeEditMagazineSize();
	afx_msg void OnEnChangeEditMagazineFeedType();
	
	CEdit m_eb1;
	CEdit m_eb2;
	CEdit m_eb3;
	CEdit m_eb4;
	CEdit m_eb5;
	CEdit m_eb6;
	CEdit m_eb7;
	
	afx_msg void OnCbnSelchangeComboMagazineCaliber();
	afx_msg void OnCbnSelchangeComboMagazineAmmoType();
	afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
  afx_msg void OnBnClickedPower();
	
  void OnOK();
	void OnCancel();
	

  BOOL PreTranslateMessage(MSG* pMsg) 
  {
    if(pMsg->message >= WM_MOUSEFIRST && pMsg->message <= WM_MOUSELAST)
      m_tooltip.RelayEvent(pMsg);

    return CDialog::PreTranslateMessage(pMsg);
  }
};
